package br.ufpe.cin.imlm2.util.path;


public interface Path<T> extends Iterable<T> {

	/**
	 * Gets the starting point of this path.
	 * 
	 * @return The starting point of this path.
	 * @throws EmptyPathException
	 *             If this path is empty.
	 */
	public abstract T getStartingPoint() throws EmptyPathException;

	/**
	 * Gets the end point of this path.
	 * 
	 * @return The end point of this path.
	 * @throws EmptyPathException
	 *             If this path is empty.
	 */
	public abstract T getEndPoint() throws EmptyPathException;

	/**
	 * Tells whether or not this path is an empty path.
	 * 
	 * @return
	 */
	public abstract boolean isEmpty();

	/**
	 * Returns the length of this path. Must return 0 in the case of an empty
	 * path.
	 * 
	 * @return
	 */
	public abstract int length();
	
	/**
	 * Returns true if this path contains otherPath.
	 * A path is contained within another if all of its nodes between the starting point (inclusive)
	 * and the end point (inclusive) are part of the other path in the proper sequence.<br>
	 * If otherPath is empty returns true. 
	 * @param otherPath
	 * @return
	 */
	public abstract boolean contains(Path<T> otherPath);

}